/*
-----------------------------------------------------------------------------
This source file is part of Labor3D
(Labor 3D Graphics Engine)

Copyright (c) 2009-2020 Rock Mao
* creator : Rock Mao
* created : 2009-5-2   22:29
* filename: LaborRenderSysObjest.h
-----------------------------------------------------------------------------
*/

#ifndef __LABORRENDERSYSOBJEST_H__
#define __LABORRENDERSYSOBJEST_H__
#include "../LaborCoreDef.h"
#include "../Common/LaborBaseObject.h"

NAMESPACE_LABOR3D_BEGIN
class LABORCORE_API   IRenderSysObject : public IBaseObject
{
public:
	IRenderSysObject() { }
protected:
	ILRenderSystem* m_pRenderSys;
	IRenderSysObject(ILRenderSystem* pOwner);
	virtual ~IRenderSysObject();
public:
	IMPL_BASE_OBJECT_CLASSID_INTERFACE(IRenderSysObject);
	virtual void*       handle() {return 0 ; }
	virtual bool        lockRenderApiObject()  {return true ; }
	virtual bool        unlockRenderApiObject(){return true ;  }
	virtual ILRenderSystem* renderApi()const { return m_pRenderSys ; }
	virtual void        setRenderApi(ILRenderSystem* pRenderApi){  m_pRenderSys = pRenderApi ; }
};

class LABORCORE_API  IRenderSysResource : public IRenderSysObject
{
public:
	IRenderSysResource() { }
protected:
	IRenderSysResource(ILRenderSystem* pOwner);
	virtual ~IRenderSysResource();
public:
	IMPL_BASE_OBJECT_CLASSID_INTERFACE(IRenderSysResource);
	ILRenderSystem*           renderApi()const {return m_pRenderSys ; }
	virtual void*                   handle() {return 0 ; }
	//virtual eResourceType res_type() const  = 0 ;
	virtual bool                    load(const wchar_t* fileName , unsigned long  arg) = 0;
	virtual bool                    load(const wchar_t* fileName , const xint8_u* buf , size_t bufLen, unsigned long arg) = 0;
	virtual bool                    isLoaded()   = 0;
	virtual bool                    unload() = 0;
	virtual unsigned long     memUsage() = 0;
};

NAMESPACE_LABOR3D_END

#endif